feat: bilingual (中文/English) dashboard, Chinese by default - #3
Merged
Conversation
johnsonice
commented
Jul 1, 2026
Contributor
- Dashboard artifact gains an EN/中文 toggle, defaulting to 中文; UI chrome and the strategy/rationale prose both localize.
- Opportunity 'thesis' and 'risks' now accept a localizedText value (a plain string or a {en, zh} object), so scan output carries both languages; build_data maps it through and the template renders the active language.
- artifacts.md / orchestration.md / SKILL.md document producing bilingual prose; tests cover localizedText mapping.
- Dashboard artifact gains an EN/中文 toggle, defaulting to 中文; UI chrome and the
strategy/rationale prose both localize.
- Opportunity 'thesis' and 'risks' now accept a localizedText value (a plain string
or a {en, zh} object), so scan output carries both languages; build_data maps it
through and the template renders the active language.
- artifacts.md / orchestration.md / SKILL.md document producing bilingual prose;
tests cover localizedText mapping.
There was a problem hiding this comment.
Pull request overview
This PR adds bilingual (中文/English) support to the generated dashboard artifact, defaulting the UI to Chinese while allowing an instant in-dashboard toggle to English. It also extends the opportunity/run data model so thesis/risks (and other user-facing prose) can be provided as either plain strings or {en, zh} objects and rendered in the active language.
Changes:
- Add zh/en i18n layer + language toggle to the dashboard HTML template (default zh via
meta.lang/ localStorage override). - Update
assets/build_data.pyto emit bilingualstrategy_note/gate_noteand pass through localized thesis/risks without stringifying objects. - Update schema + documentation and add unit tests covering localizedText mapping and
meta.langdefault/override.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_build_data.py | Adds tests validating bilingual gate_note/strategy_note, localized thesis/risks passthrough, and meta.lang behavior. |
| SKILL.md | Documents that the dashboard is bilingual by default and how to set run.json.lang. |
| reference/orchestration.md | Instructs sub-agents to output bilingual thesis/risks compatible with the dashboard toggle. |
| reference/opportunity.schema.json | Introduces localizedText (string or {en, zh}) and applies it to thesis and risks[]. |
| reference/artifacts.md | Documents bilingual rendering expectations and meta.lang in the DATA schema. |
| assets/dashboard-template.html | Implements the zh/en toggle, UI-string i18n, and rendering of {en, zh} data values via tv(). |
| assets/build_data.py | Emits bilingual STRATEGY_NOTES / GATE_REASON_NOTES, wraps unknown gate reasons, and sets meta.lang (default zh). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| var vol=m.volume_24h?'<span>'+t("card.vol24")+' <b>$'+compact(m.volume_24h)+'</b></span>':""; | ||
| var tl=timeLeft(m), tlHTML=tl?'<span class="mtime '+tl.cls+'">'+esc(tl.txt)+'</span>':""; | ||
| var tag=m.category?'<span class="mtag">'+esc(m.category)+'</span>':""; | ||
| return '<div class="mkt" data-idx="'+idx+'" role="button" tabindex="0" aria-label="'+esc(m.question)+' — open details">'+ |
| var flow=num(m.net_flow), flowTxt=(m.net_flow==null||m.net_flow==="")?"":'<span>'+t("card.flow")+' <b class="'+(flow>=0?"pos":"neg")+'">'+(flow>=0?"+":"−")+"$"+compact(flow)+'</b></span>'; | ||
| var vol=m.volume_24h?'<span>'+t("card.vol24")+' <b>$'+compact(m.volume_24h)+'</b></span>':""; | ||
| var tl=timeLeft(m), tlHTML=tl?'<span class="mtime '+tl.cls+'">'+esc(tl.txt)+'</span>':""; | ||
| var tag=m.category?'<span class="mtag">'+esc(m.category)+'</span>':""; |
| '<div class="mkt-block"><div class="block-head"><span class="eyebrow">Order book</span></div>'+bookHTML(m.depth)+'</div>'+ | ||
| (url?'<a class="trade" href="'+esc(url)+'" target="_blank" rel="noopener noreferrer" aria-label="Trade '+esc(m.question)+' on Polymarket">Trade on Polymarket <span class="ext" aria-hidden="true">↗</span></a>':'')+ | ||
| '<div class="mkt-block"><div class="block-head"><span class="eyebrow">'+t("card.orderBook")+'</span></div>'+bookHTML(m.depth)+'</div>'+ | ||
| (url?'<a class="trade" href="'+esc(url)+'" target="_blank" rel="noopener noreferrer" aria-label="'+esc(m.question)+'">'+t("card.trade")+' <span class="ext" aria-hidden="true">↗</span></a>':'')+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.